package com.yonyou.iuap.ipaas.connector.sdwcoatencent.internal.utils;

import cn.hutool.json.JSONUtil;
import org.slf4j.Logger;

/**
 * 日志工具类
 */
public class LogUtil {

    public static final String LINKER_CODE = "lx-erp";

    private LogUtil() {
    }

    /**
     * 连接器操作-入口日志打印
     */
    public static <T> void start(Logger logger, String apiUri, T body) {
        logger.error("【start】【连接器编码】linker_code:{},【操作API】apiUri={} 【请求参数】{}", LINKER_CODE, apiUri, JSONUtil.toJsonStr(body));
    }

    public static <T> void apiInfo(Logger logger, String apiUri, String resInfo) {
        logger.error("【apiInfo】【连接器编码】linker_code:{},【操作API】apiUri={},{})", LINKER_CODE, apiUri, resInfo);
    }

    /**
     * 连接器操作-出口日志打印
     */
    public static <T> void end(Logger logger, String apiUri, T output) {
        logger.error("【end】【连接器编码】linker_code:{},【操作API】apiUri={} 【返回结果】Result.output={}", LINKER_CODE, apiUri, JSONUtil.toJsonStr(output));
    }


}
